<script setup lang="ts">
const props = defineProps<{
  current: string
  isExpand: boolean
}>()

const emit = defineEmits<{
  (event: 'click'): void
}>()

const buttonLabel = computed(() => {
  return props.isExpand ? '折叠' : '展开'
})

function onButtonClick() {
  emit('click')
}
</script>

<template>
  <h1>当前选中：{{ current }}</h1>
  <div class="card">
    <ElButton type="primary" @click="onButtonClick">{{ buttonLabel }}</ElButton>
  </div>
</template>
